/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package jp.co.irep.juten.entity;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author toan_nguyen
 */
@Entity
@Table(name = "item_edit_status")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ItemEditStatus.findAll", query = "SELECT i FROM ItemEditStatus i"),
    @NamedQuery(name = "ItemEditStatus.findByManageNo", query = "SELECT i FROM ItemEditStatus i WHERE i.itemEditStatusPK.manageNo = :manageNo"),
    @NamedQuery(name = "ItemEditStatus.findByItemName", query = "SELECT i FROM ItemEditStatus i WHERE i.itemEditStatusPK.itemName = :itemName"),
    @NamedQuery(name = "ItemEditStatus.findByEditStatus", query = "SELECT i FROM ItemEditStatus i WHERE i.editStatus = :editStatus")})
public class ItemEditStatus implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected ItemEditStatusPK itemEditStatusPK;
    @Column(name = "edit_status")
    private Short editStatus;

    public ItemEditStatus() {
    }

    public ItemEditStatus(ItemEditStatusPK itemEditStatusPK) {
        this.itemEditStatusPK = itemEditStatusPK;
    }

    public ItemEditStatus(int manageNo, short itemName) {
        this.itemEditStatusPK = new ItemEditStatusPK(manageNo, itemName);
    }

    public ItemEditStatusPK getItemEditStatusPK() {
        return itemEditStatusPK;
    }

    public void setItemEditStatusPK(ItemEditStatusPK itemEditStatusPK) {
        this.itemEditStatusPK = itemEditStatusPK;
    }

    public Short getEditStatus() {
        return editStatus;
    }

    public void setEditStatus(Short editStatus) {
        this.editStatus = editStatus;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (itemEditStatusPK != null ? itemEditStatusPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ItemEditStatus)) {
            return false;
        }
        ItemEditStatus other = (ItemEditStatus) object;
        if ((this.itemEditStatusPK == null && other.itemEditStatusPK != null) || (this.itemEditStatusPK != null && !this.itemEditStatusPK.equals(other.itemEditStatusPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "jp.co.irep.tech.juten.jpa.entity.ItemEditStatus[ itemEditStatusPK=" + itemEditStatusPK + " ]";
    }
    
}
